<?php

function enemyDAO_findAll() {
	return array(
	array("level"=>1, "image"=>"/lobd/img/wolf.jpg"),
	array("level"=>1, "image"=>"/lobd/img/wolf2.jpg"),
	array("level"=>2, "image"=>"/lobd/img/wolf2.jpg")
	);
}

function enemyDAO_findByLevel($level) {
	return array_filter(enemyDAO_findAll(),
		function($value) use ($level) { return $value["level"] == $level; });
}

function enemyDAO_findRandomByLevel($level) {
	$arrayEnemy = enemyDAO_findByLevel($level);
	return $arrayEnemy[array_rand($arrayEnemy)];
}
